﻿<%@ Page Title="" Language="C#" MasterPageFile="/Medianamik/MasterPages/MedianamikModule.Master"
    AutoEventWireup="True" CodeBehind="ForumUserManagement.aspx.cs" Inherits="Medianamik.UI.Web.Forum.ForumUserManagement" %>

<asp:Content ID="ContextMenuContent" ContentPlaceHolderID="ContextMenu" runat="server">
    <asp:LinkButton ID="SaveBtn" runat="server" Text="<%$ Resources: Medianamik_Global, SaveButtonText %>"
        CssClass="Action BtSauvegarder SuspendLock" OnClick="Save" />
    <a href="<%= ReturnURL %>" class="Action BtAnnuler unlock"><%=Resources("Medianamik_Global", "Cancel") %></a>
</asp:Content>
<asp:Content ID="CenterContent" ContentPlaceHolderID="CenterContent" runat="server">
    <asp:ScriptManagerProxy runat="server">
        <Services>
            <asp:ServiceReference Path="/Medianamik/Services/LockWebService.asmx" />
        </Services>
    </asp:ScriptManagerProxy>
    <asp:UpdatePanel ID="MainUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
        <ContentTemplate>
            <med:MedianamikFormTemplate ID="FormTemplate" runat="server">
                <Template>
	                    <h2><asp:Literal ID="SubTitle" runat="server" Text="<%$ Resources: Medianamik_SecurityManagement, NewUserTitle %>" /></h2>

	                    <fieldset class="Colonne">
	                        <asp:PlaceHolder ID="UserNameDatails" runat="server">
    	                        <div class="EditionControl">
    	                            <asp:Label AssociatedControlID="UserName" runat="server" ><span class="ChampObligatoire">*</span><asp:Literal runat="server" Text="<%$ Resources: Medianamik_SecurityManagement, UserNameLabel %>" /></asp:Label>
    	                            <asp:TextBox id="UserName" runat="server" CssClass="TxtBox" autocomplete="off" AutoCompleteType="Disabled" />
		                            <asp:RequiredFieldValidator runat="server" Display="None" EnableClientScript="false" ControlToValidate="UserName" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, ErrorEmptyUsername  %>"   ></asp:RequiredFieldValidator>
		                            <asp:CustomValidator runat="server" Display="None" EnableClientScript="false" OnServerValidate="UsernameValidate" ControlToValidate ="UserName" ErrorMessage = "<%$ Resources: Medianamik_SecurityManagement, UserAlreadyExistsError %>"></asp:CustomValidator>  
		                        </div>
		                    </asp:PlaceHolder>
		                    <div class="EditionControl">
		                        <asp:Label runat="server" AssociatedControlID = "Email"><span class="ChampObligatoire">*</span><asp:Literal runat="server" Text="<%$Resources: Medianamik_SecurityManagement, EmailLabel  %>" /></asp:Label>
		                        <asp:TextBox runat="server" ID="Email" CssClass="TxtBox" autocomplete="off" AutoCompleteType="Disabled" />
	                            <asp:RequiredFieldValidator runat="server" Display = "None" EnableClientScript="false" ControlToValidate ="Email" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, ErrorEmptyEmailAddress %>"></asp:RequiredFieldValidator>
	                            <asp:RegularExpressionValidator runat="server"  Display="None" EnableClientScript="false" ControlToValidate="Email" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, ErrorInvalidEmailAddress %>" ValidationExpression="^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$"></asp:RegularExpressionValidator>
	                        </div>
	                        <asp:PlaceHolder ID="PasswordAndEmailConfigurations" runat="server">
                                <div class="EditionControl">
		                            <asp:CheckBox ID="SendEmail" runat="server" Text="<%$ Resources: Medianamik_SecurityManagement, SendConfirmationEmailQuestion %>" Checked="true" />
		                        </div>
		                        <div class="EditionControl">
                                    <asp:CheckBox runat="server" ID="AutoGeneratePwd" AutoPostBack="true" OnCheckedChanged ="AutoGeneratePwdCheckedChanged" Text="<%$ Resources: Medianamik_SecurityManagement, AutoGeneratePasswordLabel %>" />
                                </div>
                                <asp:PlaceHolder ID="PasswordAutoGeneration" runat="server">
                                    <p><asp:Literal runat="server" Text="<%$ Resources: Medianamik_SecurityManagement, PasswordWillBeAutoGenerated %>" /></p>
                                </asp:PlaceHolder>
                            </asp:PlaceHolder>
                            <asp:PlaceHolder ID="PasswordDetails" runat="server">
                                <div class="EditionControl">
                                  <asp:Label runat="server" AssociatedControlID="Password"><asp:Literal runat="server" Text="<%$Resources: Medianamik_SecurityManagement, PasswordLabel  %>" /></asp:Label>
                                  <asp:TextBox id="Password" runat="server" CssClass="TxtBox" TextMode="Password" autocomplete="off" AutoCompleteType="Disabled" />
                                   <asp:RequiredFieldValidator runat="server" ID="PasswordRequired"  EnableClientScript="false" ControlToValidate="Password" Display="None" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, PasswordRequiredError %>" ></asp:RequiredFieldValidator>
                                   <asp:CustomValidator ID="PasswordStrength" runat="server" EnableClientScript="false" ControlToValidate="Password" Display="None" OnServerValidate="PasswordStrengthValidate" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, PasswordStrengthError %>" ></asp:CustomValidator>
                                </div> 
                                <div class="EditionControl">
                                    <asp:Label runat="server" AssociatedControlID= "ConfirmedPassword"><asp:Literal runat="server" Text="<%$Resources: Medianamik_SecurityManagement, PasswordConfirmationLabel  %>" /></asp:Label>
                                    <asp:TextBox ID="ConfirmedPassword" runat="server" CssClass="TxtBox" autocomplete="off" AutoCompleteType="Disabled" TextMode="Password" />
                                </div>
                                <div class="EditionControl">
                                    <strong><asp:Literal runat="server" Text="<%$ Resources: Medianamik_SecurityManagement, PasswordRulesLabel %>" /></strong>
                                </div>
                                <ul>
                                    <li><asp:Literal runat="server" Text="<%$Resources: Medianamik_SecurityManagement, MinRequiredPasswordLength %>" /> <strong><%= Membership.MinRequiredPasswordLength  %></strong></li>
                                    <li><asp:Literal ID="Literal3" runat="server" Text="<%$Resources: Medianamik_SecurityManagement, MinRequiredNonAlphanumericCharacters %>" /> <strong><%= Membership.MinRequiredNonAlphanumericCharacters  %></strong></li>
                                </ul>
	                            <asp:CustomValidator ID="PasswordCompare" runat="server" EnableClientScript="false" ControlToValidate="Password" Display="none" ValidateEmptyText="true"
	                                OnServerValidate="PasswordCompareValidate" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, PasswordsDoNotMatchError %>" />   
                            </asp:PlaceHolder>
	                    </fieldset>
	                    <fieldset class="Colonne">
		                    <med:MedianamikPropertyControl runat="server" PropertyName="FullName" HideMultiLingualControls="true" />
                            <med:MedianamikPropertyControl runat="server" PropertyName="ExpirationDate" HideMultiLingualControls="true" />
                            <med:MedianamikPropertyControl runat="server" PropertyName="UICultureName" HideMultiLingualControls="true" />
		                    <div class="EditionControl">
		                        <asp:CheckBox runat="server" ID="Approved" Checked="true" Text="<%$ Resources: Medianamik_SecurityManagement, User_IsApprovedChekbox %>" />
		                    </div>
		                    <div class="EditionControl">
		                        <asp:Label runat="server" AssociatedControlID="Groups" ><span class="ChampObligatoire">*</span><asp:Literal runat="server" Text="<%$Resources: Medianamik_SecurityManagement, GroupsLabel  %>" /></asp:Label>
		                        <med:GroupCheckBoxList id="Groups" runat="server" />
		                    </div>
	                    </fieldset>
	                    <div class="clear"></div>
                </Template>
            </med:MedianamikFormTemplate>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>